package com.jishuo.nontax.view.controller;

import com.jishuo.base.bean.BaseResult;
import com.jishuo.base.bean.vo.UserVO;
import com.jishuo.base.util.GTimeUtil;
import com.jishuo.nontax.bfc.service.FiscService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

/**
 * @auther dinggaofei
 * @Date 2023/3/29 13:42
 */
@Slf4j
@Controller
@RequestMapping(value = "/view/fisc",name = "化解国库柜面")
public class FiscViewController {
    private String prefix = "view/";
    @Resource
    private FiscService fiscService;


    @RequestMapping(value = {"payfiscview", "payfiscview/{page}"}, name = "化解国库柜面")
    public String index(@PathVariable(required = false) String page) {
        return prefix + ((page == null) ? "payfiscview" : page);
    }
    @ResponseBody
    @RequestMapping(value = "queryPayFiscData", name = "化解国库")
    public BaseResult queryPayFiscData(String billnum) {
        return fiscService.getPayFisc(billnum);
    }

    @ResponseBody
    @RequestMapping(value = "payfiscpayview",name = "化解国库付款")
    public BaseResult payfiscpayview(String  billnum, String bankaffirm, HttpSession session){
        UserVO  user = (UserVO) session.getAttribute("login_user");
        return fiscService.setFiscPayInfo(billnum, bankaffirm, GTimeUtil.getDateTimeMark(), user.getBankStationName(), "");
    }
}
